package com.ruoyi.web.xxj.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 文创购买记录对象 product_order
 *
 * @author ruoyi
 * @date 2024-02-23
 */
@ApiModel("产文创订单")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ProductOrder implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    @ApiModelProperty("文创产品主键ID")
    @Excel(name = "文创产品主键ID")
    private Long productId;

    /**
     * 小程序用户主键ID
     */
    @ApiModelProperty("小程序用户主键ID")
    @Excel(name = "小程序用户主键ID")
    private Long wechatUserid;

    /**
     * 订单号
     */
    @ApiModelProperty("订单号")
    @Excel(name = "订单号")
    private String orderNo;

    /**
     * 文创退款订单编号
     */
    @ApiModelProperty("文创退款订单编号")
    @Excel(name = "文创退款订单编号")
    private String refundNo;

    /**
     * 微信交易流水编号
     */
    @ApiModelProperty("微信交易流水编号")
    @Excel(name = "微信交易流水编号")
    private String wxpayTradeNo;

    /**
     * 产品名称
     */
    @ApiModelProperty("产品名称")
    @Excel(name = "产品名称")
    private String productName;

    @ApiModelProperty("购买数量")
    @Excel(name = "购买数量")
    private Integer payNum;

    /**
     * 支付金额
     */
    @ApiModelProperty("应付金额")
    @Excel(name = "应付金额")
    private BigDecimal payAmount;

    @ApiModelProperty("实际支付金额")
    @Excel(name = "实际支付金额")
    private BigDecimal realPayAmount;

    /**
     * 支付状态：0-未支付；1-已支付；2-退款待审核；3-退款通过审核；4-拒绝退款；5-已退款；6-退款失败；7-取消订单
     */
    @ApiModelProperty("支付状态：0-未支付；1-已支付；2-退款待审核；3-退款通过审核；4-拒绝退款；5-已退款；6-退款失败；7-取消订单")
    @Excel(name = "支付状态",readConverterExp = "0=未支付,1=已支付,2=退款待审核,3=退款通过审核,4=拒绝退款,5=已退款,6=退款失败,7=取消订单")
    private String payStatus;

    /**
     * 取消订单原因
     */
    @ApiModelProperty("取消订单原因")
    @Excel(name = "取消订单原因")
    private String cancelReason;

    /**
     * 拒绝取消订单原因
     */
    @ApiModelProperty("拒绝取消订单原因")
    @Excel(name = "拒绝取消订单原因")
    private String rejectCancelReason;
    
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    @Excel(name = "备注")
    private String remark;
    
    /**
     * 创建者
     */
    @ApiModelProperty("创建者")
    private String createBy;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    /**
     * 更新者
     */
    @ApiModelProperty("更新者")
    private String updateBy;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @ApiModelProperty("文创产品")
    private Product product;

    public ProductOrder(Long productId, Long wechatUserid, String orderNo, String productName, Integer payNum,
                        BigDecimal payAmount, BigDecimal realPayAmount) {
        super();
        this.productId = productId;
        this.wechatUserid = wechatUserid;
        this.orderNo = orderNo;
        this.productName = productName;
        this.payNum = payNum;
        this.payAmount = payAmount;
    }

    public ProductOrder(String orderNo, String wxpayTradeNo) {
        super();
        this.orderNo = orderNo;
        this.wxpayTradeNo = wxpayTradeNo;
    }

}
